void OnAnimatorIK(int LayerIndex)
{
    if (ikactive)
    {
        animator.SetLookAtPosition(target.transform.position);
        animator.SetLookAtWeight(1,1,1,1);
        if (lefthandle != null)
        {
            animator.SetIKPosition(AvatarIkGoal.lefthandle,lefthandle.transform.position);
            animator.SetIKRotation(AvatarIkGoal.lefthandle,lefthandle.transform.Rotation);
            animator.SetIKPositionWeight(AvatarIkGoal.lefthandle,1);
            animator.SetIKRotationWeight(AvatarIkGoal.lefthandle,1);
        }
    }   
}